package com.shrct.businessprocess.project.impl;

import com.shrct.businessprocess.project.RCCostShareYearConfig;
import com.shrct.businessprocess.project.RCCostShareYearConfigDAO;
import com.shrct.businessprocess.project.events.RCCostShareYearConfigEventsManager;
import com.shrct.businessprocess.project.impl.RCCostShareYearConfigImpl;
import edu.fudan.mylang.pf.BaseDAOService;
import org.eclipse.xtext.xbase.lib.ObjectExtensions;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.project.RCCostShareYearConfigDAO")
public class RCCostShareYearConfigDAOImpl extends BaseDAOService<RCCostShareYearConfig> implements RCCostShareYearConfigDAO {
  @Autowired
  private RCCostShareYearConfigEventsManager eventsManager;
  
  public RCCostShareYearConfig create(final Procedure1<? super RCCostShareYearConfig> init) {RCCostShareYearConfig rCCostShareYearConfig=RCCostShareYearConfigImpl.create(getObjectFactory());
    final Procedure1<RCCostShareYearConfig> _function = new Procedure1<RCCostShareYearConfig>() {
        public void apply(final RCCostShareYearConfig it) {
          init.apply(it);
          it.checkValid();
          RCCostShareYearConfigDAOImpl.this.eventsManager.fireCreated(it);
        }
      };
    RCCostShareYearConfig _doubleArrow = ObjectExtensions.<RCCostShareYearConfig>operator_doubleArrow(rCCostShareYearConfig, _function);
    return _doubleArrow;
  }
  
  public void delete(final RCCostShareYearConfig value) {getObjectFactory().delete(value);
    
    this.eventsManager.fireDeleted(value);
  }
}
